package com.demo.reports.demo6200sphone;

import android.app.Application;
import android.content.Context;

import com.zhy.http.okhttp.OkHttpUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;


/**
 * Used 自定义Application【系统上下文】
 */
public class MyApplication extends Application {


    /**系统上下文*/
    private static Context mAppContext;
    static MyApplication myApplication = new MyApplication();

    public static MyApplication getMyApplication() {
        return myApplication;
    }

public static   int position;
    public static   boolean unBind;
    @Override
    public void onCreate() {
        super.onCreate();
        mAppContext = getApplicationContext();
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(10000L, TimeUnit.MILLISECONDS)
                .readTimeout(10000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);

    }

    /**获取系统上下文：用于ToastUtil类*/
    public static Context getAppContext()
    {
        return mAppContext;
    }
}